package com.xiaoyushu.oss.biz.service.impl;

import com.xiaoyushu.framework.common.response.Response;
import com.xiaoyushu.oss.biz.service.FileService;
import com.xiaoyushu.oss.biz.strategy.FileStragegy;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

@Service
public class FileServiceImpl implements FileService {


    @Resource
    private FileStragegy fileStragegy;
    /**
     * 上传文件
     *
     * @param file
     */
    @Override
    public Response<?> uploadFile(MultipartFile file) {
        //上传文件到
        String url = fileStragegy.uploadFile(file, "xiaoyushu");
        return Response.success(url);
    }
}
